package com.example.viewpagerandlistview.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.example.viewpagerandlistview.R;
import com.example.viewpagerandlistview.adapter.ListViewAdapter;

public class Fragment2 extends Fragment {

    private View view;
    private ListView listView;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment2_layout,container,false);
        initView();
        initData();
        initEvent();
        return view;
    }

    private void initView() {
        listView = view.findViewById(R.id.listview);
        listView.setAdapter(new ListViewAdapter(getContext(),new String[]{"小明","小红","小白","小黑"}));
    }
    private void initData() {
    }

    private void initEvent() {
    }
}
